/*
 * Powered By [rapid-framework]
 * Web Site: http://www.rapid-framework.org.cn
 * Google Code: http://code.google.com/p/rapid-framework/
 * Since 2008 - 2013
 */

package com.bbs.bean;

import javacommon.base.BaseEntity;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;

import org.apache.commons.lang.builder.EqualsBuilder;
import org.apache.commons.lang.builder.HashCodeBuilder;
import org.apache.commons.lang.builder.ToStringBuilder;
import org.apache.commons.lang.builder.ToStringStyle;
import org.hibernate.annotations.GenericGenerator;
import org.hibernate.validator.constraints.Length;

/**
 * @author badqiu email:badqiu(a)gmail.com
 * @version 1.0
 * @since 1.0
 */


@Entity
@Table(name = "bbs_log_info")
public class BbsLogInfo extends BaseEntity implements java.io.Serializable{
	private static final long serialVersionUID = 5454155825314635342L;
	
	//alias
	public static final String TABLE_ALIAS = "BbsLogInfo";
	public static final String ALIAS_LOG_ID = "日志id";
	public static final String ALIAS_LOG_USERID = "用户id";
	public static final String ALIAS_LOG_USERNAME = "用户名称";
	public static final String ALIAS_LOG_TYPE = "状态（0：登录，1：退出）";
	public static final String ALIAS_LOG_TIME = "时间";
	
	//date formats
	

	//可以直接使用: @Length(max=50,message="用户名长度不能大于50")显示错误消息
	//columns START
    /**
     * 日志id       db_column: log_id 
     */ 	
	
	private java.lang.Integer logId;
    /**
     * 用户id       db_column: log_userid 
     */ 	
	
	private java.lang.Integer logUserid;
    /**
     * 用户名称       db_column: log_username 
     */ 	
	@Length(max=50)
	private java.lang.String logUsername;
    /**
     * 状态（0：登录，1：退出）       db_column: log_type 
     */ 	
	
	private java.lang.Integer logType;
    /**
     * 时间       db_column: log_time 
     */ 	
	@Length(max=20)
	private java.lang.String logTime;
	//columns END


	public BbsLogInfo(){
	}

	public BbsLogInfo(
		java.lang.Integer logId
	){
		this.logId = logId;
	}

	

	public void setLogId(java.lang.Integer value) {
		this.logId = value;
	}
	
	@Id @GeneratedValue(generator="custom-id")
	@GenericGenerator(name="custom-id", strategy = "increment")
	@Column(name = "log_id", unique = true, nullable = false, insertable = true, updatable = true, length = 10)
	public java.lang.Integer getLogId() {
		return this.logId;
	}
	
	@Column(name = "log_userid", unique = false, nullable = true, insertable = true, updatable = true, length = 10)
	public java.lang.Integer getLogUserid() {
		return this.logUserid;
	}
	
	public void setLogUserid(java.lang.Integer value) {
		this.logUserid = value;
	}
	
	@Column(name = "log_username", unique = false, nullable = true, insertable = true, updatable = true, length = 50)
	public java.lang.String getLogUsername() {
		return this.logUsername;
	}
	
	public void setLogUsername(java.lang.String value) {
		this.logUsername = value;
	}
	
	@Column(name = "log_type", unique = false, nullable = true, insertable = true, updatable = true, length = 10)
	public java.lang.Integer getLogType() {
		return this.logType;
	}
	
	public void setLogType(java.lang.Integer value) {
		this.logType = value;
	}
	
	@Column(name = "log_time", unique = false, nullable = true, insertable = true, updatable = true, length = 20)
	public java.lang.String getLogTime() {
		return this.logTime;
	}
	
	public void setLogTime(java.lang.String value) {
		this.logTime = value;
	}
	

	public String toString() {
		return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
			.append("LogId",getLogId())
			.append("LogUserid",getLogUserid())
			.append("LogUsername",getLogUsername())
			.append("LogType",getLogType())
			.append("LogTime",getLogTime())
			.toString();
	}
	
	public int hashCode() {
		return new HashCodeBuilder()
			.append(getLogId())
			.toHashCode();
	}
	
	public boolean equals(Object obj) {
		if(obj instanceof BbsLogInfo == false) return false;
		if(this == obj) return true;
		BbsLogInfo other = (BbsLogInfo)obj;
		return new EqualsBuilder()
			.append(getLogId(),other.getLogId())
			.isEquals();
	}
}

